<template>
	<!-- 红包卡券 -->
	<view class="redPacketItem">
		<view class="redPacketName">
			<view class="price">
				<text style="font-size: 14px;">￥</text>{{couponInfo.price}}
			</view>
			<view class="full">
				满{{couponInfo.full}}使用
			</view>
		</view>
		
		<view class="redPacketGz">
			<view class="name">
				{{couponInfo.name}}
			</view>
			
			<view class="money">
				{{couponInfo.store.name|| '平台券' }}
			</view>
		</view>
		
		<view class="btnBox">
			<view class="" v-if="couponInfo.is_receive">
				<view class="btn">
					已领取
				</view>
			</view>
			
			<view class="" v-else>
				<view class="btn" v-if="couponInfo.status == 1">
					已使用
				</view>
				<view  v-else-if="couponInfo.status == 0 || !couponInfo.status">
					<view class="btn active" @click="getCoupon(couponInfo.id)" >
						{{couponType == 'drawDown' ?'领取':'去使用'}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"hwxcRedPacketItem",
		data() {
			return {
				
			};
		},
		props:{
			couponInfo:{
				type:Object,
				default:()=>{}
			},
			couponType:{
				type:String,
				default:""
			}
		},
		methods:{
			getCoupon(id){
				this.$emit('subCoupon',id)
			}
		}
	}
</script>

<style scoped lang="scss">
	.redPacketItem{
		display: flex;
		align-items: center;
		justify-content: space-between;
		.redPacketName{
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: column;
			width: 120px;
			border-right: 2px #d3d3d3 dashed;
			.price{
				font-size: 26px;
				color: #e43927;
				font-weight: bold;
			}
			.full{
				margin-top: 5px;
				font-size: 26rpx;
				color: #999;
			}
		}
		
		.redPacketGz{
			flex: 1;
			box-sizing: border-box;
			padding-left: 30rpx;
			.money{
				color: #999;
				font-size: 12px;
			}
			.name{
				font-size: 30rpx;
				font-weight: bold;
				color: #444;
				margin-bottom: 20rpx;
			}
			
		}
		
		.btnBox{
			.btn{
				padding: 10rpx 30rpx;
				background-color: #f3f3f3;
				border-radius: 8rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 12px;
				color: #444;
			}
			
			.active{
				background-color: #e43927;
				color: #f3f3f3;
			}
		}
	}
</style>